package com.daqsoft.dao.project;

import com.daqsoft.data.User;
import com.daqsoft.data.project.Project;
import com.daqsoft.data.project.Task;
import com.daqsoft.dto.StatusEnum;
import com.daqsoft.dto.TaskTypeEnum;
import org.springframework.data.jpa.repository.JpaRepository;

import java.util.List;

/**
 * 任务持久层
 * @author 周麟东 on 11:49
 */
public interface TaskDao extends JpaRepository<Task,Integer>{

    List<Task> findTaskByStatus(StatusEnum statusEnum);

    List<Task> findTaskByPrincipal(User principal);

    List<Task> findTaskByPrincipalAndStatus(User principal,StatusEnum statusEnum);

    List<Task> findTaskByVerifier(User user);

    List<Task> findTaskByVerifierAndStatus(User user , StatusEnum statusEnum);

    List<Task> findByProject(Project project);

    List<Task> findByProjectAndStatus(Project project,StatusEnum statusEnum);

    List<Task> findByTypeAndPrincipal(TaskTypeEnum type , User user);

    List<Task> findByProjectAndType(Project project, TaskTypeEnum taskTypeEnum);
}
